FROM harbor.snyq.ltd/public/node:11.12.0

#作者信息
MAINTAINER phantomjs实现截图 821781113@qq.com

# yum环境处理
RUN rm -rf /etc/yum.repos.d/*
COPY CentOS-snyq.repo /etc/yum.repos.d/CentOS-snyq.repo
RUN yum clean all ;  yum install -y fontconfig freetype bzip2  bitmap-fonts bitmap-fonts-cjk

#提前安装好phantomjs,phantom驱动回去检测并下载(速度很慢所以这里提前安装好)
#下载地址 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
COPY phantomjs-2.1.1-linux-x86_64 /phantomjs-2.1.1-linux-x86_64
ENV PHANTOMJS_HOME=/phantomjs-2.1.1-linux-x86_64
ENV PATH=$PATH:$PHANTOMJS_HOME/bin

#复制文件
WORKDIR /app
COPY package.json  package.json
COPY server.js server.js

#安装依赖(registry在node-v11.12.0已定义为阿里云的,这里修改为自定义)
RUN npm config set registry http://nexus.snyq.ltd:8081/repository/npm-public/

RUN npm install
 
EXPOSE 9053
 
ENTRYPOINT ["node","server.js"]
